package com.emperor.category.app;

import java.util.Map;
import org.eclipse.swt.SWT;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import com.emperor.core.app.App;
import com.emperor.core.app.AppBase;
import com.emperor.inventory.app.InventoryAppCtrl;
import com.swtdesigner.SWTResourceManager;

public class CategoryAppDel extends AppBase implements App {

	protected Shell shell;

	public CategoryAppDel() {
		super();
	}
	
	public CategoryAppDel(Map<String, Object> params) {
		super();
		this.params = params;
	}

	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			CategoryAppDel window = new CategoryAppDel();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window
	 */
	public void open() {
		final Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}

	/**
	 * Create contents of the window
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
		shell.setBackgroundImage(SWTResourceManager.getImage(CategoryAppDel.class, "/img/main.jpg"));
		shell.setImage(SWTResourceManager.getImage(CategoryAppDel.class, "/img/iMac OSX.png"));
		shell.setSize(1000, 700);
		shell.setText("Delete Category");
		//
		buildStandardMenu(getShell(), getParams(), InventoryAppCtrl.INVENTORY_CTRL, InventoryAppCtrl.INVENTORY_ENQ);
	}

	public Shell getShell() {
		return shell;
	}

}
